Electrodes can be implanted into target tissue to record from and stimulate the target tissue. For example, depth electrodes can be implanted into peripheral nerves or brain tissue. The electrical signals recorded by the electrode can aid in the diagnosis and treatment of neurological diseases.